import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  //resolve 添加别名
  resolve: {
    alias: [
      {
        find: '@',
        replacement: '/src'
      }
    ]
  },
  server: { 
    proxy: {
      // 配置代理规则
      '/api': {
        target: 'http://localhost:8089', 
        // target: 'http://192.168.71.130:10000', 
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
      '/chat': {
        target: 'http://localhost:8086',
        // target: 'http://192.168.71.130:10006', 
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/chat/, '')
      }
    }
  }
  
})
